﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="info.aspx.cs" Inherits="text.info" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <head >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script>
        function checkpwd() {
            //获取两个密码框的值，判断是否相同
            var pwd = document.getElementById("txtpwd");
            var rpwd = document.getElementById("txtrepwd");
            if (pwd.value != rpwd.value) {
                alert('两次密码不一致，请检查!');
                return false;
            }

        }
        function ajaxsend() {
            var name = document.getElementById("txtname").value;
            var xhttp = new XMLHttpRequest();//创建对象
            //配置异步访问对象相关请求参数  参数1：http请求方式  参数2:接口地址  参数3：异步请求
            xhttp.open("GET", "acc.ashx?act=" + name, true);
            //ajax请求发送
            xhttp.send();
            //回调函数
            xhttp.onreadystatechange = function () {
                if (this.readyState == 4 && this.status == 200) {
                    //业务代码
                    var result = xhttp.responseText;//获取接口的响应文本
                    //true:账号能用  span标签隐藏
                    var sp = document.getElementById("sp1");
                    if (result == "true") {
                        sp.style.display = "none";
                    }
                    //false:账号不能用 span标签显示
                    else {
                        sp.style.display = "block";
                    }
                }
            }
        }
        function checkempty() {
            var txt1 = document.getElementById("txtname");
            var txt2 = document.getElementById("txtpwd");
            if (txt1.value == "") {
                alert('账户不能为空');
                return false;
            }
            if (txt2.value == "") {
                alert('密码不能为空');
                return false;
            }
            return ture;
        }
    </script>
    <link href="css/style.css" rel="stylesheet">
    <link href="css/font.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>

<body>
 <div class="box_right col-lg-9 ">
	<div class="segment left">
		
					<i class=" glyphicon glyphicon-book left" ></i>
					<h3 class="left">
							修改个人资料<br>
							<span>管理这个设备及其传感器</span>
					</h3>			
	</div>
   		
          <div class="clear"></div>
        <!--注册开始-->
        <div id="body">
            <div id="reg_box" class="left">
                <div method="post" action="/" role="form" autocomplete="on">
                    <div class="my-group">
                        <span class="left">姓名</span>
                        <asp:TextBox CssClass="form-control put1" ID="txtname" runat="server" onblur="ajaxsend()"></asp:TextBox>
                    </div>
                     <span id="sp1" style="color: red; display: none">该用户名已存在</span>

                    <div class="my-group">
                        <span class="left">生日</span>
                        <asp:TextBox ID="txtbirthday" CssClass="form-control put1" runat="server"></asp:TextBox>
                        &nbsp;
                    </div>

                    <div class="my-group">
                        <span class="left">密码</span>
            <asp:TextBox ID="txtpwd" CssClass="form-control put1" runat="server"></asp:TextBox>
&nbsp;
                    </div>

                    <div class="my-group">
                        <span class="left">重复密码</span>
            <asp:TextBox ID="txtrepwd" CssClass="form-control put1" runat="server" onblur="checkpwd()"></asp:TextBox>
                       
                         
                    </div>
                     <div class="my-group">
        性别<asp:RadioButton ID="rb1" runat="server" GroupName="sex" Text="男" />
   <asp:RadioButton ID="rb2" runat="server" GroupName="sex" Text="女" TabIndex="1" />
   
 </div>

                    <div class="my-group">
                        <span class="left">所在城市</span>
           
 
                    <asp:DropDownList ID="ddl" runat="server" AutoPostBack="True">
</asp:DropDownList>
           
     </div>
              

                    <div class="my-group">
                        <span class="left">上传头像</span>

                    </div>
                    <asp:FileUpload ID="FileUpload1" runat="server" />
                        <div class="my-group">
                            <asp:Image ID="Image1" runat="server" Height="84px" Width="113px" />
        <asp:Button ID="Button1" runat="server" Text="上 传" OnClick="Button1_Click1" />
    </div>
                    
                
                    <div class="my-group">
                        <span class="left">手机</span>
                        <asp:TextBox ID="txtphone" CssClass="form-control put1" runat="server"></asp:TextBox>
                        &nbsp;
                    </div>

                    <div class="my-group">
                        <span class="left">邮箱</span>
                        <asp:TextBox ID="txtemail" CssClass="form-control put1" runat="server"></asp:TextBox>
                        &nbsp;
                    </div>
                    <div class="my-group">
                        <span class="left">QQ</span>
                        <asp:TextBox ID="txtqq" CssClass="form-control put1" runat="server"></asp:TextBox>
                        &nbsp;
                    </div>

                    <div class="form-actions">
                 

                    </div>



                    <asp:Button ID="btnregister" runat="server" Text="确认修改" OnClick="btnregister_Click" OnClientClick="checkempty()" />




                </div>

            </div>

        </div>
    </div>
</body>
</asp:Content>
